package edu.pku.sei.transformation.editor.controller.commands.link;

import edu.pku.sei.transformation.editor.model.requirement.Description;
import edu.pku.sei.transformation.editor.model.requirement.DescriptionConnection;
import edu.pku.sei.transformation.editor.model.requirement.TransformationGoal;
/**
 * @deprecated
 * @author sei
 *
 */
public class DescriptionConnectionDeleteCommand extends
		AbstractLinkDeleteCommand<DescriptionConnection, TransformationGoal, Description> {
	
	public DescriptionConnectionDeleteCommand(DescriptionConnection link, TransformationGoal source, Description target) {
		super("delete description connection", link, source, target);
	}
	
	@Override
	public void execute() {
		link.setDescription(null);
		link.setGoal(null);
		source.getDescriptions().remove(link);
	}
	
	@Override
	public void undo() {
		link.setDescription(target);
		link.setGoal(source);
		source.getDescriptions().add(link);
	}

}
